(function($) {
	$.fn.outerHTML = function() {
		return $(this).clone().wrap('<div></div>').parent().html();
	};
})(jQuery);
$.fn.paginationcustom=function() {
	// consider adding an id to your table,
	// just incase a second table ever enters the picture..?
	$this=$(this);
	if($this.length && $this.attr("class").indexOf("pagin_it")!=-1){
		var items = $this.find("tbody tr:not(.cache)");
		var numItems = items.length;
		var perPage = 10;
		// only show the first 2 (or "first per_page") items initially
		items.slice(perPage).hide();
		$this.parent().append('<nav><ul class="pagination"><li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li><li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li></ul></nav>');
		// now setup your pagination
		// you need that .pagination-page div before/after your table
		$this.parent().find(".pagination").pagination({
			items: numItems,
			itemsOnPage: perPage,
			onPageClick: function(pageNumber) { // this is where the magic happens
				// someone changed page, lets hide/show trs appropriately
				var showFrom = perPage * (pageNumber - 1);
				var showTo = showFrom + perPage;
				items.hide() // first hide everything, then show for the new page
				.slice(showFrom, showTo).show();
			}
		});
		return $this;
	}
};